A thread is a sequence of instructions of a program. More specifically, a thread may be defined as the smallest sequence of programmed instructions that can be managed independently by an operating system scheduler. A program may be implemented as a single-thread or as multiple threads. A process is a sequence of programmed instructions that may comprise one or more threads.
Multi-threading is a technique in which a integrated circuit processor switches repeatedly between multiple threads of a process. The multiple threads, e.g. two, three, four, or more threads, may thus be executed quasi simultaneously. Each thread may for example be assigned a specific time slot in a frame of a processing schedule. The processing schedule may comprise a sequence of frames, each frame consisting of multiple time slots. For example, considering a process with two threads, e.g. thread zero and thread one, the integrated circuit processor may be arranged to execute thread zero during a first slot of each frame and thread one during a second slot of the same frame. Threads zero and one may thus be executed in an alternating manner. Multi-threading may thus be considered an example of time division multiplexing. The various threads within a process may share resources allocated to that process. A resource may, for example, include an amount of memory or a bus bandwidth.
US patent application publication number US 2006/0212687 A1 by Chen and Sutardja describes a integrated circuit processor comprising a set of registers wherein each set of registers is associated with a specific processor thread. In order to switch among the processor threads, a state of a currently executing processor thread is stored in a corresponding set of registers and a state of another processor thread is loaded from a corresponding set of registers to allow for processing the other processor thread.
A integrated circuit processor core may be arranged to execute various processes successively. That is, a new process may be started only when a previous process has been terminated. Ending one process and starting a subsequent process is an example of a context switch. Another example of a context switch is the suspension of a current process by an interrupt service routine in response to an interrupt. An interrupt is any event, e.g., an exception signal, that triggers execution of an interrupt service routine. An interrupt service routine is a process having a higher priority than the interrupted process. Execution of an interrupt service routine may in turn be interrupted by another interrupt service routine having an even higher priority.
Depending on the design of the integrated circuit processor, a context switch may have a latency that may be non-negligible. This may notably be the case when the integrated circuit processor needs to store the current state of a current process in a memory outside the integrated circuit processor (external memory) so that the process may be resumed at a later point in time, for instance upon completion of an interrupt service routine. Similarly, a context switch back to the original process may involve a non negligible latency as data may have to be retrieved from the external memory in order to restore the state of the original process. The latency may be reduced by providing multiple register sets inside the integrated circuit processor so that states of multiple processes may be stored within the integrated circuit processor.